package kuzmenkov.oip.controller.applet;

import java.util.List;
import java.util.Locale;
import java.util.logging.Logger;

import org.springframework.context.support.AbstractMessageSource;


/**
 * Class is responsible for to perform any client request to the server 
 * User: Michael Kuzmenkov
 * Date: 08.03.2009
 * Time: 14:51:55
 */
public class ClientServiceImpl implements ClientService{
	private static Logger log = Logger.getLogger(ClientServiceImpl.class.getName());
	
    private RemoteService remoteService;
    private AbstractMessageSource messageSource;
    
    public AbstractMessageSource getMessageSource () {
    	return messageSource;
    }
    public void setMessageSource (AbstractMessageSource messageSource){
    	this.messageSource = messageSource;
    }

    public void setRemoteService (RemoteService remoteService) {
        this.remoteService = remoteService;
    }

    public String getRemoteCallResult(String input) {
        return remoteService.getResult(input);
    }

	public List getRemoteParameters() throws Exception {
		return remoteService.getParameters();
	}

	public List getRemoteImages() throws Exception {
		
		return remoteService.getImages();
	}

	public Object[] processRemotely(Object[] params) throws Exception {
		return remoteService.process(params);
	}
	
	
	public Locale getRemoteLocale() throws Exception {
		Locale locale = remoteService.getLocale();
		log.info("remoteLocale="+locale);
		return locale;
	}
	
}
